home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…stman Always Clicks Twice / ADC Developer CD (1993-01) (''The Postman Always Clicks Twice'')_iso / Dev.CD 199301.iso / Development Platforms / CSMP Digests / csmp-v1-024.txt < prev    next >
Encoding:
Text File  |  1992-11-18  |  46.4 KB  |  1,262 lines  |  [TEXT/MPS ]

  1. C.S.M.P. Digest             Fri, 20 Mar 92       Volume 1 : Issue 24
  2.  
  3. Today's Topics:
  4.  
  5.     List manager compress font
  6.     C++ version 3 for MPW?
  7.     Dev. OO SW for the Mac Book
  8.     THINK C, TCL & Segmentation
  9.     PROLOG for MAC ?
  10.     ***EMERGENCY HELP NEEDED! ***
  11.     GetPixBaseAddr()
  12.     SndPlayFromFile in Async mode (?)
  13.     Give it to me straight (probable FAQ)
  14.     How can I hide certain folders from SFDialog?
  15.     How to test an MDEF
  16.     Menus in THINK C 5.0.2, best way??
  17.  
  18.  
  19. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  20.  
  21. These digests are available (by using FTP, account anonymous, your email
  22. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  23. edu (try skinner.cs.uoregon.edu if that doesn't work).  This is also the home
  24. of the comp.sys.mac.programmer Frequently Asked Questions list.
  25.  
  26. These digests are also available via email.  Just send a note saying that you
  27. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  28. automatically receive each new digest as it is created.
  29.  
  30. The articles in these digests are taken directly from comp.sys.mac.programmer.
  31. They are not edited; all articles included in this digest are in their original
  32. posted form.  The only articles that are -not- included in these digests are
  33. those which didn't receive any replies (except those that give information
  34. rather than ask a question).  All replies to each article are concatenated
  35. onto the original article in the order in which they were received.  Article
  36. threads are not added to the digests until the last article added to the
  37. thread is at least one month old (this is to ensure that the thread is dead
  38. before adding it to the digests).
  39.  
  40. Send administrative mail to mkelly@cs.uoregon.edu.
  41.  
  42. -------------------------------------------------------
  43.  
  44. From: russotto@eng.umd.edu (Matthew T. Russotto)
  45. Subject: List manager compress font
  46. Date: Mon, 10 Feb 92 15:41:46 GMT
  47. Organization: University of Maryland, College Park, College of Engineering
  48.  
  49.  
  50. Is there a way of turning off the change to compressed style that LDEF 0
  51. does when a column is too narrow?  Right now I replaced StdText and StdTxMeas
  52. with routines which call TextFace(thePort->txFace & ~compress), but that
  53. seems ugly.
  54. -- 
  55. Matthew T. Russotto    russotto@eng.umd.edu    russotto@wam.umd.edu
  56. Your superior intellect is no match for our puny weapons! -- The Simpsons
  57. Just say NO to police searches and seizures.  Make them use force.
  58. (not responsible for bodily harm resulting from following above advice)
  59.  
  60.  
  61.  
  62. - -------------------------
  63.  
  64. From: keith@Apple.COM (Keith Rollin)
  65. Subject:  List manager compress font
  66. Date: 14 Feb 92 02:08:09 GMT
  67. Organization: Apple Computer Inc., Cupertino, CA
  68.  
  69. In article <1992Feb10.154146.14532@eng.umd.edu> russotto@eng.umd.edu (Matthew T. Russotto) writes:
  70. >
  71. >Is there a way of turning off the change to compressed style that LDEF 0
  72. >does when a column is too narrow?  Right now I replaced StdText and StdTxMeas
  73. >with routines which call TextFace(thePort->txFace & ~compress), but that
  74. >seems ugly.
  75.  
  76. If I were in your position, I'd probably just write my own LDEF rather
  77. than patch two traps. Writing an LDEF is really simple, and writing one
  78. that mimics the standard LDEF is the simplest of the simple. I've found
  79. that looking at the LDEF with the ResEdit CODE editor and translating
  80. it into C in THINK C to be really painless. Or, you can copy down the
  81. source to the LDEF from ftp.apple.com. Since that LDEF is from 6.0.4,
  82. it doesn't have the compressed text feature. Just assemble it and off
  83. you go.
  84.  
  85. -- 
  86. - ----------------------------------------------------------------------------
  87. Keith Rollin           ---            <Taligent .signature under construction>
  88. Disclaimer: Pretty soon, I really _won't_ be speaking for Apple...
  89.  
  90.  
  91.  
  92. - -------------------------
  93.  
  94. From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser)
  95. Subject:  List manager compress font
  96. Date: 14 Feb 92 18:36:48 GMT
  97. Organization: MacDTS, Apple Computer
  98.  
  99. In article <1992Feb10.154146.14532@eng.umd.edu>, russotto@eng.umd.edu (Matthew T. Russotto) writes:
  100. > Is there a way of turning off the change to compressed style that LDEF 0
  101. > does when a column is too narrow?  Right now I replaced StdText and StdTxMeas
  102. > with routines which call TextFace(thePort->txFace & ~compress), but that
  103. > seems ugly.
  104.  
  105. Rewrite LDEF 0.  This is pretty trivial; it can probably be done with less
  106. than one page of code.  And since you're doing it anyway, you'll get a
  107. chance to add formatting features you probably wanted to add anyway.
  108.  
  109. Tim Dierks
  110. MacDTS, but I speak for myself
  111.  
  112.  
  113.  
  114. ---------------------------
  115.  
  116. From: pl@Apteryx.DoCS.UU.SE (Per Lindgren)
  117. Subject: C++ version 3 for MPW?
  118. Date: 10 Feb 92 19:07:35 GMT
  119. Organization: Dept. of computer systems, Uppsala university
  120.  
  121. -- 
  122.  
  123. I'm not a frequent reader of this group, so please bear with me if this is an
  124. "old" question.
  125.  
  126. When are we going to see a 3.0 C++ for MPW?
  127.  
  128.  
  129.   --------------------------------------------------------------------------
  130.   |Per Lindgren              |    EMail: Per.Lindgren@DoCS.UU.SE       |
  131.   |Dept. of Computer Systems      |    Phone: +4618183173           |
  132.   |Uppsala University, SWEDEN     |    FAX: +4618550225           |
  133.   --------------------------------------------------------------------------
  134.  
  135.  
  136.  
  137. - -------------------------
  138.  
  139. From: ksand@apple.com (Kent Sandvik)
  140. Subject:  C++ version 3 for MPW?
  141. Date: 13 Feb 92 20:09:33 GMT
  142. Organization: MacDTS Mongols
  143.  
  144. In article <1992Feb10.190735.7989@corax.udac.uu.se>, pl@Apteryx.DoCS.UU.SE (Per Lindgren) writes:
  145. > I'm not a frequent reader of this group, so please bear with me if this is an
  146. > "old" question.
  147.  
  148. > When are we going to see a 3.0 C++ for MPW?
  149.  
  150. If I would answer that I would be cleaning the streets of San Jose the
  151. next week :-). Frankly speaking, speculation type questions will seldom
  152. have any realistic answers, especially from Apple employees. And outside
  153. Apple people may or may not have clues, which leads to MacWeek style
  154. speculation which randomly touches reality base, especially in our industry
  155. where things might change quite rapidly.
  156.  
  157. Kent
  158.  
  159.  
  160.  
  161. ---------------------------
  162.  
  163. From: rdominy@kong.gsfc.nasa.gov (Robert Dominy)
  164. Subject: Dev. OO SW for the Mac Book
  165. Date: 10 Feb 92 19:52:49 GMT
  166. Organization: NASA Goddard Space Flight Center
  167.  
  168. Can anyone tell me whether the book _Developing Object Oriented Software
  169. for the Macintosh_ by Jeff Alger and Neal Goldstein is being distributed
  170. yet?
  171.  
  172. Also, are there any other references for their Solution-Based Modelling
  173. development methodology?  All I've see so far is the blurb in the MADA
  174. conference announcement.
  175.  
  176. - ------------------------------
  177. Robert Dominy
  178. NASA Goddard Space Flight Center
  179.  
  180.  
  181.  
  182. - -------------------------
  183.  
  184. From: ksand@apple.com (Kent Sandvik)
  185. Subject:  Dev. OO SW for the Mac Book
  186. Date: 13 Feb 92 20:26:46 GMT
  187. Organization: MacDTS Mongols
  188.  
  189. In article <1992Feb10.195249.1770@kong.gsfc.nasa.gov>, rdominy@kong.gsfc.nasa.gov (Robert Dominy) writes:
  190. > Can anyone tell me whether the book _Developing Object Oriented Software
  191. > for the Macintosh_ by Jeff Alger and Neal Goldstein is being distributed
  192. > yet?
  193.  
  194. What I've heard A&W has announced the availability of the book, and based
  195. on the bookstore you might find it any day. I'm sure it's on sale at 
  196. the MADA Orlando conference later this month.
  197.  
  198. > Also, are there any other references for their Solution-Based Modelling
  199. > development methodology?  All I've see so far is the blurb in the MADA
  200. > conference announcement.
  201.  
  202. The book and their presentations are the references.
  203.  
  204. Kent Sandvik/DTS
  205.  
  206.  
  207.  
  208. ---------------------------
  209.  
  210. From: Daryl_Spitzer@mindlink.bc.ca (Daryl Spitzer)
  211. Subject: THINK C, TCL & Segmentation
  212. Date: 11 Feb 92 01:42:12 GMT
  213. Organization: MIND LINK! - British Columbia, Canada
  214.  
  215. On page 120 of the THINK C Object-Oriented Programming
  216. Manual it states that certain files must be in a resident segment.  Also,
  217. I have begun using the Inside Out database engine, whose documentation
  218. states that their routine ISOUnloadSeg (which calls _UnloadSeg for each of
  219. their segments) should be called regularly, although certain segments
  220. should be marked as pre-load and locked.
  221.  
  222. Am I correct in assuming that THINK C & TCL will not unload segments
  223. itself unless I call _UnloadSeg?  (Unlike MacApp, which I gather will
  224. unload any segment unless it's specified in a res! resource.)  How do I
  225. mark a segment as pre-load and locked?  If the only way to do it is
  226. through ResEdit, then I guess I'd be unable to lock segments when running
  227. the program from the compiler?
  228.  
  229. Any pointers to parts of the THINK C User Manual, Inside Mac or THINK
  230. Reference would be appreciated - I haven't been able to find the answers
  231. to these questions there.
  232. --
  233. - -----------------------------------------------------------------
  234.  Daryl_Spitzer@mindlink.bc.ca     "Life isn't just, life just is."
  235.          a2251@mindlink.bc.ca              -- Me  (I think.)
  236.        Spitzer@UNCAMULT.BITNET
  237. - -----------------------------------------------------------------
  238.  
  239.  
  240.  
  241. - -------------------------
  242.  
  243. From: ksand@apple.com (Kent Sandvik)
  244. Subject:  THINK C, TCL & Segmentation
  245. Date: 14 Feb 92 05:25:07 GMT
  246. Organization: MacDTS Mongols
  247.  
  248. In article <9956@mindlink.bc.ca>, Daryl_Spitzer@mindlink.bc.ca (Daryl Spitzer) writes:
  249. > On page 120 of the THINK C Object-Oriented Programming
  250. > Manual it states that certain files must be in a resident segment.  Also,
  251. > I have begun using the Inside Out database engine, whose documentation
  252. > states that their routine ISOUnloadSeg (which calls _UnloadSeg for each of
  253. > their segments) should be called regularly, although certain segments
  254. > should be marked as pre-load and locked.
  255. > Am I correct in assuming that THINK C & TCL will not unload segments
  256. > itself unless I call _UnloadSeg?  (Unlike MacApp, which I gather will
  257. > unload any segment unless it's specified in a res! resource.)  How do I
  258. > mark a segment as pre-load and locked?  If the only way to do it is
  259. > through ResEdit, then I guess I'd be unable to lock segments when running
  260. > the program from the compiler?
  261.  
  262. You could use SetResAttrs() to specify resource attributes, as in this ad 
  263. hoc code:
  264.  
  265. short  attrs;
  266. Handle myHandle;
  267.  
  268. myHandle = GetResource('CODE', 200);
  269. if(myHandle != NULL){
  270.    SetResAttrs(myHandle, attrs | resLocked | resPreLoad);
  271.    LoadResource('CODE', 200); /* load the resource into memory */
  272. }
  273. /* fix the CODE resource on the disk */
  274.    ChangedResource(myHandle); /* flag the resource for update */
  275.    ReleaseResource(myHandle); /* discard it */
  276.  
  277. I just wrote it from top up my head, so if there are any bugs, please
  278. correct them.
  279.  
  280. As for knowing what segments should be resident, it's really up to the
  281. framework provider to make sure this information is available. In MacApp
  282. resident code is usually flagged with a #pragma ARes statement (MacApp 3.0),
  283. also Main and a couple of other segments are always resident.
  284.  
  285. Kent Sandvik/DTS
  286.  
  287.  
  288.  
  289. ---------------------------
  290.  
  291. From: bk@merlin.par.univie.ac.at (Bernhard Knaus)
  292. Subject: PROLOG for MAC ?
  293. Organization: University of Austria
  294. Date: Tue, 11 Feb 1992 13:30:38 GMT
  295.  
  296. Is there a PROLOG System for MAC? - If you know somthing about that,
  297. please let me know that.
  298.  
  299. Thanks Bernhard Knaus
  300. bk@par.univie.ac.at
  301.  
  302.  
  303.  
  304.  
  305. - -------------------------
  306.  
  307. From: quinn@cs.uwa.oz.au (Quinn "The Eskimo!")
  308. Subject:  PROLOG for MAC ?
  309. Date: 12 Feb 92 01:52:00 GMT
  310. Organization: The University of Western Australia
  311.  
  312. In article <1992Feb11.133038.21388@swdsrv.edvz.univie.ac.at>, bk@merlin.par.univie.ac.at (Bernhard Knaus) writes:
  313. > Is there a PROLOG System for MAC? - If you know somthing about that,
  314. > please let me know that.
  315. > Thanks Bernhard Knaus
  316. > bk@par.univie.ac.at
  317.  
  318. Our department has been using Logic Programming Associates MacProlog for
  319. the past 5 years.  It's now at version 3.5.  I really like it but I'm most
  320. probably biased (-:
  321.  
  322. The reference manual gives their address as:
  323.  
  324.   Logic Programming Associates Ltd
  325.   Studio 4, Royal Victoria Patriotic Building  [Love that building name (-: ]
  326.   Trinity Road
  327.   LONDON  SW183SX
  328.   England
  329.  
  330.   Tel:     01 871 2016
  331.   Fax:     01 874 0449
  332.   Dialcom: 84:LPA001
  333.  
  334. I hope this helps.
  335.  
  336. Quinn "The Eskimo!"   <quinn@cs.uwa.oz.au>   "Real Coke, Diet .sig"
  337. Department of Computer Science, The University of Western Australia
  338.  
  339.  
  340.  
  341. - -------------------------
  342.  
  343. From: wingo@apple.com (Tony Wingo)
  344. Subject:  PROLOG for MAC ?
  345. Date: 14 Feb 92 19:03:53 GMT
  346. Organization: Apple Computer
  347.  
  348. In article <1992Feb11.133038.21388@swdsrv.edvz.univie.ac.at>, bk@merlin.par.univie.ac.at (Bernhard Knaus) writes:
  349. > Is there a PROLOG System for MAC? - If you know somthing about that,
  350. > please let me know that.
  351. > Thanks Bernhard Knaus
  352. > bk@par.univie.ac.at
  353. There is a freeware prolog called Open Prolog from Trinity College in Dublin,
  354. available via anonymous ftp from grattan.cs.tcd.ie, in the directory
  355. tcd/mac.  The latest version I've seen is 1.0d28, so it is still under
  356. development and has a few some rough edges. It has an interface that is 
  357. similar to MPW, and is fairly nicely done. It lacks things like full
  358. toolbaox integration that you get with the commercial products.  
  359. But then, what do you want for free?
  360.  
  361. -tony
  362.  
  363. >>usual disclaimers apply<<
  364.  
  365.  
  366.  
  367. ---------------------------
  368.  
  369. From: weiser@pogo.mmc.com (Matt Weiser)
  370. Subject: ***EMERGENCY HELP NEEDED! ***
  371. Organization: Martin Marietta WIS
  372. Date: Tue, 11 Feb 1992 14:16:28 GMT
  373.  
  374. We are creating a rather large application in MPW C++ and
  375. have run into a Link Error:
  376.  
  377. Link:Warning: Size of global data area exceeds 65k. (Error 34)
  378.  
  379. We are getting "Out of Memory" errors at runtime, and think
  380. this is the reason.  The linker lists this as a Warning -- is it
  381. something that would cause the app to crash?  If it is not something
  382. to really worry about, how do we suppress the linker warnings?
  383. Looking at the .map file created there is something called "hasContents"
  384. all over the place in the GlobalData Segment.  Does anyone know what
  385. these are?  Do they have something to do with the virtual table access?
  386.  
  387. Do literals such as    char * string = "Where do I go in Memory?"
  388.    get placed in the global data area ?
  389.  
  390. What exactly is placed in the Gobal data area ?
  391.      String Literals ?
  392.      Global variables ?    
  393.      Virtual tables for Classes ?
  394.  
  395. (Mac IIfx, MPW 3.2, System 7.0, 20 MB ram)
  396.  
  397. Any help is appreciated.  This thing is due Monday and if we don't get
  398. it out, there will be 7 C++ programmers available....
  399.  
  400. Matt Weiser
  401. Martin Marietta Western Internal Systems
  402. weiser@pogo.mmc.com
  403. (303) 971-4060
  404.  
  405.  
  406.  
  407. - -------------------------
  408.  
  409. From: ksand@apple.com (Kent Sandvik)
  410. Subject:  ***EMERGENCY HELP NEEDED! ***
  411. Date: 14 Feb 92 05:38:44 GMT
  412. Organization: MacDTS Mongols
  413.  
  414. In article <1992Feb11.141628.29592@den.mmc.com>, weiser@pogo.mmc.com (Matt Weiser) writes:
  415. > We are creating a rather large application in MPW C++ and
  416. > have run into a Link Error:
  417. > Link:Warning: Size of global data area exceeds 65k. (Error 34)
  418.  
  419. The default global data segment is 32k max, in order to get bigger 
  420. global data you need to use model far support with the linker and compiler.
  421. This is available starting with MPW 3.2.
  422.  
  423. > We are getting "Out of Memory" errors at runtime, and think
  424. > this is the reason.  The linker lists this as a Warning -- is it
  425. > something that would cause the app to crash?  If it is not something
  426. > to really worry about, how do we suppress the linker warnings?
  427.  
  428. I don't think these errors are corresponding, or then they correspond in
  429. a loose way. "Out of Memory" would indicate lack of application space,
  430. problems with the stack, and similar issues related to dynamic use of memory.
  431. The global data space is once and for all setup during _RTInit time, so
  432. I don't think >32k global data would cause memory problems during runtime
  433. (I might be wrong...).
  434.  
  435. Check for any other typical memory problems, monitor memory use (StackSize(),
  436. GetApplLimit()), watch what is going on in the heap with MacsBug and any
  437. other debugger, and so on...
  438.  
  439. > Looking at the .map file created there is something called "hasContents"
  440. > all over the place in the GlobalData Segment.  Does anyone know what
  441. > these are?  Do they have something to do with the virtual table access?
  442.  
  443. > Do literals such as    char * string = "Where do I go in Memory?"
  444. >    get placed in the global data area ?
  445.  
  446. Yes, if they are declared global, and they are awful when you want to
  447. sell the application in Japan, Sweden or Germany, because the guy/girl
  448. who is going to translate the menus and user interface messages into Swahili
  449. or Finnish can't use ResEdit or any other tools provided by Apple for
  450. internationalization. Please use STR# resources, you will get *less* global
  451. data space use, and people in Iceland will be happy and send you a Christmas
  452. present.
  453.  
  454. Now the -b2 might be a temporary bless in your case, it will trigger the compiler
  455. to place string literals in code, and also overlay them (MPW 3.2 C forward...).
  456. Anyway, STR resources is really the way to go in the long run.
  457.  
  458. > What exactly is placed in the Gobal data area ?
  459. >      String Literals ?
  460. >      Global variables ?    
  461. >      Virtual tables for Classes ?
  462.  
  463. It really depends on the environment and compiler. In the C++ case you will
  464. get string literals, virtual tables, %_static_constructors_and_destructors resource,
  465. static constructors/destructors. I have not encountered many cases in my career
  466. where the global data segment is overloaded with stuff, not even in the MacApp case.
  467. However if most of your strings are in the global data space, and any other possible
  468. big arrays, I guess you could break the limits.
  469.  
  470.  
  471. Kent Sandvik/DTS
  472.  
  473.  
  474.  
  475. ---------------------------
  476.  
  477. From: duga@koala.cvs.rochester.edu (Brady Duga)
  478. Subject: GetPixBaseAddr()
  479. Date: 11 Feb 92 15:01:40 GMT
  480. Organization: Center for Visual Science, U. of Rochester
  481.  
  482.  
  483. I seem to be having some trouble with GetPixBaseAddr() (at least I think I'm
  484. having trouble)...
  485.  
  486. When I call this with the portPixMap field of an offscreen drawing world,
  487. I get the value 0xC88001B0. However, when I dereference the handle and look
  488. at the baseAddr field, I get 0xC880007C. Is this discrepancy normal? I'm trying
  489. to track down the cause of a bus error, and seems to be located somewhere
  490. near a spot where I add an offset to the returned base address.
  491.  
  492. --Brady (duga@cvs.rochester.edu)
  493.  
  494.  
  495.  
  496. - -------------------------
  497.  
  498. From: berdahl@applelink.apple.com (Eric Berdahl)
  499. Subject:  GetPixBaseAddr()
  500. Date: 14 Feb 92 19:29:59 GMT
  501. Organization: Apple Computer
  502.  
  503. In article <1992Feb11.150140.9871@galileo.cc.rochester.edu>, duga@koala.cvs.rochester.edu (Brady Duga) writes:
  504. > I seem to be having some trouble with GetPixBaseAddr() (at least I think I'm
  505. > having trouble)...
  506.  
  507. Stop thinking.  You are having trouble.  There is a bug in the early versions
  508. of 32-bit quickdraw.  Namely GetPixBaseAddr doesnUt.  It returns the first
  509. word of the GrafPort in the high word of the result and the high word of
  510. the baseAddr in the low word of the result.  In short, it doesnUt work.
  511. Period.  The work-around is to fetch the baseAddr yourself.
  512.  
  513. This is fixed in System 7.0.
  514.  
  515. Eric
  516.  
  517.  
  518.  
  519. ---------------------------
  520.  
  521. From: stephenm@syacus.acus.oz.au (Stephen McIntosh)
  522. Subject: SndPlayFromFile in Async mode (?)
  523. Date: 11 Feb 92 22:11:29 GMT
  524. Organization: ACUS Australian Centre for Unisys Software, Sydney
  525.  
  526. I have tried unsuccessfully to play an AIFF file on disk using the
  527. Async mode in SndPlayFromFile call.
  528.  
  529. I keep getting back an error saying insufficient hardware (-205 I think?).
  530.  
  531. If anyone has some working code that they can show me, it will help...
  532.  
  533. Thanks in advance
  534. Stephen McIntosh
  535. -- 
  536. Sincerely
  537. Stephen McIntosh
  538. ACUS-The Australian Centre for UNISYS software
  539. Phone:    +61-2-390-1371    | ACSnet:   stephenm@syacus.OZ
  540.  
  541.  
  542.  
  543. - -------------------------
  544.  
  545. From: REEKES@applelink.apple.com (Jim Reekes)
  546. Subject:  SndPlayFromFile in Async mode (?)
  547. Date: 15 Feb 92 00:41:26 GMT
  548. Organization: Apple Computer, Inc.
  549.  
  550. In article <1992Feb11.221129.27087@syacus.acus.oz.au>, stephenm@syacus.acus.oz.au (Stephen McIntosh) writes:
  551. > I have tried unsuccessfully to play an AIFF file on disk using the
  552. > Async mode in SndPlayFromFile call.
  553. > I keep getting back an error saying insufficient hardware (-205 I think?).
  554.  
  555. SndPlayFromFile is not currently implemented on machines that do not have
  556. the Apple Sound Chip.
  557.  
  558.  
  559. - -----------------------------------------------------------------
  560. Jim Reekes, E.O.             |     Macintosh Toolbox Engineering
  561.                              |          Sound Manager Expert
  562. Apple Computer, Inc.         | All opinions expressed are mine, and
  563. 20525 Mariani Ave. MS: 81-EQ |  do not necessarily represent those
  564. Cupertino, CA 95014          |  of my employer, Apple Computer Inc.
  565.  
  566.  
  567.  
  568. - -------------------------
  569.  
  570. From: stephenm@syacus.acus.oz.au (Stephen McIntosh)
  571. Subject:  SndPlayFromFile in Async mode (?)
  572. Date: 18 Feb 92 23:40:47 GMT
  573. Organization: ACUS Australian Centre for Unisys Software, Sydney
  574.  
  575. REEKES@applelink.apple.com (Jim Reekes) writes:
  576.  
  577. >In article <1992Feb11.221129.27087@syacus.acus.oz.au>, stephenm@syacus.acus.oz.au (Stephen McIntosh) writes:
  578. >> I have tried unsuccessfully to play an AIFF file on disk using the
  579. >> Async mode in SndPlayFromFile call.
  580. >> I keep getting back an error saying insufficient hardware (-205 I think?).
  581.  
  582. I use an SE/30(includes an ASC) but the SndPlayfromFile (using NIL 
  583. as the snd channel) does not work. It only works for Sync playing. 
  584.  
  585. IM VI states that the Snd Mgr will allocate a channel and play 
  586. it for you. The work around that appears to work is to allocate 
  587. a sound channel and then use this to play the sound
  588. Async.
  589.  
  590. Hope this info is helpful.
  591. Regards
  592. Steve McIntosh
  593. -- 
  594. Sincerely
  595. Stephen McIntosh
  596. ACUS-The Australian Centre for UNISYS software
  597. Phone:    +61-2-390-1371    | ACSnet:   stephenm@syacus.OZ
  598.  
  599.  
  600.  
  601. ---------------------------
  602.  
  603. From: mod@masscomp.westford.ccur.com (2915)
  604. Subject: Give it to me straight (probable FAQ)
  605. Date: 14 Feb 92 04:12:38 GMT
  606. Organization: Concurrent Computer Corp. Westford MA.
  607.  
  608.  
  609.  
  610. I just bought a used SE30 for my wife to do her schoolwork and
  611. for me to play with.  It's a nice machine but I hate not knowing
  612. ANYTHING about how a Mac works under the hood.  Please email
  613. suggestions to me regarding the best sources of information in
  614. order that I can DMA the complete body of knowledge and Mac lore
  615. into my brain.  I don't want cutesy beginner stuff, I want full
  616. and detailed specs:  driver interfaces, filesystem, memory map,
  617. boot procedure, etc....  I want everything you'd need to write
  618. an OS for the Mac hardware and everything you'd need to write
  619. a large and complex program for the existing Mac OS (not that
  620. I currently plan to do either).  I bought The Macintosh Bible
  621. but, although it's nice, it's not really what I'm looking for.
  622.  
  623. Thanks.
  624.  ------------------------------------------------------------------
  625.  Michael O'Donnell     mod@westford.ccur.com     uunet!masscomp!mod
  626.  Concurrent Computer Corporation     Westford, MA     (508)392-2915
  627.  NOTE:  Opinions I express are unlikely to be those of my employer.
  628.  ------------------------------------------------------------------
  629.  
  630.  
  631.  
  632.  
  633. - -------------------------
  634.  
  635. From: dirty@engin.umich.edu (Cameron Javad Esfahani)
  636. Subject:  Give it to me straight (probable FAQ)
  637. Date: 14 Feb 92 20:48:23 GMT
  638. Organization: University of Michigan
  639.  
  640. You want to get the Inside Macintosh Volumes I-VI from Addison-Wesley.
  641. They tell you everything you need to know about programming the 
  642. Macintosh.
  643.  
  644. --
  645. Cameron Esfahani        LED...ZEPPELIN...IS...BACK!!
  646. dirty@engin.umich.edu        I admit it, I broke Mike's lamp, I'm sorry...
  647. VizLab, USENET, Macintosh,    "Alright!  Let's do it"
  648. X-windows CAEN Support
  649.  
  650.  
  651.  
  652. - -------------------------
  653.  
  654. From: scott@mcl.mcl.ucsb.edu (Scott Bronson)
  655. Subject:  Give it to me straight (probable FAQ)
  656. Date: 17 Feb 92 02:16:06 GMT
  657.  
  658. In <DIRTY.92Feb14154823@waltz.engin.umich.edu> dirty@engin.umich.edu (Cameron Javad Esfahani) writes:
  659.  
  660. >You want to get the Inside Macintosh Volumes I-VI from Addison-Wesley.
  661. >They tell you everything you need to know about programming the 
  662. >Macintosh.
  663.  
  664. IM doesn't even come close to telling you everything you need to know
  665. about programming the Macintosh.  Tech Notes and Tech Docs supplement IM,
  666. APDA produces all kinds of other documents on more vertical topics (how
  667. to write your own external file system) etc...
  668.  
  669. Inside Macintosh is a great place to begin, but it sure doesn't go the length.
  670.  
  671.  
  672.    - Scott            +----------------: SCOTT BRONSON :-----------------+
  673. +---------------------|  scott@mcl.ucsb.edu    2025sbsb@ucsbuxa.ucsb.edu |
  674. | Programming in C is | 6850 El Colegio Road #234; Goleta, CA 93117-4300 |
  675. | glissading indoors. +==================================================+
  676. +=========================+
  677.  
  678.  
  679.  
  680. - -------------------------
  681.  
  682. From: casseres@apple.com (David Casseres)
  683. Subject:  Give it to me straight (probable FAQ)
  684. Date: 17 Feb 92 17:43:20 GMT
  685. Organization: Apple Computer
  686.  
  687. In article <scott.698292966@mcl>, scott@mcl.mcl.ucsb.edu (Scott Bronson) writes:
  688. > In <DIRTY.92Feb14154823@waltz.engin.umich.edu> dirty@engin.umich.edu (Cameron Javad Esfahani) writes:
  689. > >You want to get the Inside Macintosh Volumes I-VI from Addison-Wesley.
  690. > >They tell you everything you need to know about programming the 
  691. > >Macintosh.
  692. > IM doesn't even come close to telling you everything you need to know
  693. > about programming the Macintosh.  Tech Notes and Tech Docs supplement IM,
  694. > APDA produces all kinds of other documents on more vertical topics (how
  695. > to write your own external file system) etc...
  696. > Inside Macintosh is a great place to begin, but it sure doesn't go the length.
  697.  
  698. My 2 cents:  Inside Mac is the *reference* work on the Mac, not a place to
  699. begin!  Try Chernicoff's Macintosh Revealed books, or something similar.
  700.  
  701. David Casseres
  702.  
  703.  
  704.  
  705. ---------------------------
  706.  
  707. From: wdburns@edu (Bill Burns)
  708. Subject: How can I hide certain folders from SFDialog?
  709. Organization: CCLI Macintosh Lab.
  710. Date: Fri, 14 Feb 1992 06:27:21 GMT
  711.  
  712. Hi all - 
  713.   I've got a problem that I'm not sure how/if I can change...
  714.  
  715. The local drives on our network has two folders (one includes the System Folder)which are invisible from the Finder, but which show up in certain programs'
  716. SFDialog boxes - namely MS-Word.  I'd really like to NOT LET THIS HAPPEN, as
  717. I'm sure any other network administrators would agree.  Basically I'd like
  718. either SFDialog or the programs to care about folder/file settings.  I'm not  
  719. sure if the "Desktop" file shows up or not, but I'd like to not let the user
  720. know about / enter certain directories on teh local disk.
  721.  
  722. Does anyone know why SFDialog disregards the folder attributes?
  723. Is there an easy way around this?
  724. Should I be settings some OTHER bits?
  725.  
  726. Note: machines in question are either running system 6.0.x or system 7.
  727.  
  728. Thanks in advance!
  729.  
  730. Bill Burns (wdburns@mtu.edu)
  731. Mac Technical Consultant, CCLI Lab
  732. Michigan Tech. University
  733.  
  734.  
  735.  
  736.  
  737.  
  738. - -------------------------
  739.  
  740. From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser)
  741. Subject:  How can I hide certain folders from SFDialog?
  742. Date: 17 Feb 92 01:52:06 GMT
  743. Organization: MacDTS, Apple Computer
  744.  
  745. In article <1992Feb14.062721.27447@ctr.columbia.edu>, wdburns@edu (Bill Burns) writes:
  746. > Hi all - 
  747. >   I've got a problem that I'm not sure how/if I can change...
  748. > The local drives on our network has two folders (one includes the System Folder)
  749. > which are invisible from the Finder, but which show up in certain programs'
  750. > SFDialog boxes - namely MS-Word.  I'd really like to NOT LET THIS HAPPEN, as
  751. > I'm sure any other network administrators would agree.  Basically I'd like
  752. > either SFDialog or the programs to care about folder/file settings.  I'm not  
  753. > sure if the "Desktop" file shows up or not, but I'd like to not let the user
  754. > know about / enter certain directories on teh local disk.
  755. > Does anyone know why SFDialog disregards the folder attributes?
  756. > Is there an easy way around this?
  757. > Should I be settings some OTHER bits?
  758. > Note: machines in question are either running system 6.0.x or system 7.
  759. > Thanks in advance!
  760.  
  761.     This is due to a limitation in the original SFGetFile and SFPGetFile calls, which
  762. is that there's no way to filter folders, only files.  Basically, when you call
  763. GetFile, you can either tell it do display some number of file types (including none)
  764. by passing a non-negative count for your file types list, or you can say that you'll
  765. filter the files yourself, by passing -1 as your file type count.  Normally invisible
  766. files and folders are excluded from the file list, but when you provide a filter
  767. function, Standard File allows the programmer to control their display.  However,
  768. because the entire architecture dates from pre-HFS, flat file system, days, folders
  769. are not passed to the filtering function to examine; thus, there's no way for a
  770. program to keep invisible folders from being displayed.  As far as I know, there's
  771. no easy way around it; the only people I know of to have worked around it did it
  772. by patching PBGetCatInfo to totally skip invisible folders, not a task for the faint
  773. of heart.
  774.     All this was fixed with the addition of the new StandardGetFile and CustomGetFile
  775. commands in System 7, but it will probably be a while before programs begin to use
  776. these calls exclusively, and there's not much hope for System 6 at all.
  777.  
  778. Tim Dierks
  779. MacDTS, but I speak for myself
  780.  
  781.  
  782.  
  783. ---------------------------
  784.  
  785. From: felciano@medisg.stanford.edu (Ramon Felciano)
  786. Subject: How to test an MDEF
  787. Date: 14 Feb 92 17:45:51 GMT
  788. Organization: SUMMIT, Stanford U. Medical Media & Information Technologies
  789.  
  790. Hi!
  791.  
  792. Is there any convenient way of testing an MDEF? I'm writing one, and right
  793. now I'm compiling it into a code resource, quitting THINK Pascal, using
  794. Resedit to copy it into my dummy program, and launching that program
  795. (usually to a crash!).
  796.  
  797. Isn't there a way of testing this from within THINK Pascal?
  798.  
  799. Thanks.
  800.  
  801. Ramon M. Felciano
  802. Associate Director, SUMMIT
  803. Stanford University Medical Media and Information Technologi
  804.  
  805.  
  806.  
  807. - -------------------------
  808.  
  809. From: oster@well.sf.ca.us (David Phillip Oster)
  810. Subject:  How to test an MDEF
  811. Date: 17 Feb 92 05:57:16 GMT
  812. Organization: Whole Earth 'Lectronic Link, Sausalito, CA
  813.  
  814. MDEFs can be debugged from inside applications by allocating a menu with a
  815. proc id of 9 (the standard menu proc), then storing into its proc field,
  816. a handle, length 6 bytes, consisting of the 68000 machine language value of
  817. a JMP instruction followed by the address of the MyMDEFProc(). You may even
  818. wantt to use this technique in the finished application, since that gives the
  819. MDEF procedure access to the global variables of the application, although,
  820. given what apple has done to uis in the past, I'd save and restore register A5
  821. to make sure our MDEF is looking at the right set of global variables.
  822. -- 
  823. -- David Phillip Oster - At least the government doesn't make death worse.
  824. -- oster@well.sf.ca.us = {backbone}!well!oster
  825.  
  826.  
  827.  
  828. - -------------------------
  829.  
  830. From: lim@iris.ucdavis.edu (Lloyd Lim)
  831. Subject:  How to test an MDEF
  832. Date: 18 Feb 92 10:52:02 GMT
  833. Organization: U.C. Davis - Department of Electrical Engineering and Computer Science
  834.  
  835. In article <30061@well.sf.ca.us> oster@well.sf.ca.us (David Phillip Oster) writes:
  836.  
  837. >MDEFs can be debugged from inside applications by allocating a menu with a
  838. >proc id of 9 (the standard menu proc), then storing into its proc field,
  839. >a handle, length 6 bytes, consisting of the 68000 machine language value of
  840. >a JMP instruction followed by the address of the MyMDEFProc(). You may even
  841. >wantt to use this technique in the finished application, since that gives the
  842. >MDEF procedure access to the global variables of the application, although,
  843. >given what apple has done to uis in the past, I'd save and restore register A5
  844. >to make sure our MDEF is looking at the right set of global variables.
  845.  
  846. If you do this, you're writing self-modifying code and you'll have to
  847. flush the instruction cache or you'll break on Quadras.
  848.  
  849. I've heard of two better ways of dealing with this:
  850.  
  851. 1)  Store the address at the end of the code.  Use LEA and MOVE to shove it
  852. into A0, for example, and then JMP to it.
  853.  
  854. 2)  Store the address in some other convenient place.  Most defprocs have
  855. a refcon or data field that they can access.  Menus are a problem because
  856. they don't have either.  You could cram it into the menuData somewhere but
  857. you should make sure that your menu items still flash correctly.  (See
  858. Tech Note 222.)
  859.  
  860. +++
  861. Lloyd Lim     Internet: lim@iris.cs.ucdavis.edu
  862.               America Online: LimUnltd
  863.               Compuserve: 72647,660
  864.               US Mail: 224 Lysle Leach Hall, U.C. Davis, Davis, CA 95616
  865.  
  866.  
  867.  
  868. - -------------------------
  869.  
  870. From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser)
  871. Subject:  How to test an MDEF
  872. Date: 17 Feb 92 01:28:35 GMT
  873. Organization: MacDTS, Apple Computer
  874.  
  875. In article <1992Feb14.174551.4020@leland.Stanford.EDU>, felciano@medisg.stanford.edu (Ramon Felciano) writes:
  876. > Is there any convenient way of testing an MDEF? I'm writing one, and right
  877. > now I'm compiling it into a code resource, quitting THINK Pascal, using
  878. > Resedit to copy it into my dummy program, and launching that program
  879. > (usually to a crash!).
  880. > Isn't there a way of testing this from within THINK Pascal?
  881.  
  882. Use one of my favorite tricks, the 6-byte resource trick.  Create a test
  883. program which uses your MDEF.  Add your MDEF function to the program, then
  884. create a 6-byte resource of type MDEF, with the appropriate resoure ID,
  885. which you add to your program.  In your program, load the MDEF and fill
  886. the first two bytes with $4EF9 and the last four bytes with a pointer to
  887. your MDEF function (which you link in with your code).  The $4EF9 is a JMP
  888. instruction; this way, the menu manager will attempt to load this resource
  889. and call it; it will then jump to your code, in your program.  Thus, you
  890. can compile and test, compile and test, without building a custom resource
  891. each time.  Furthermore, you can now debug your resource with the standard
  892. source code debugger.
  893.  
  894. I almost forgot- it's very important that you flush the instruction cache
  895. after filling in the 6-byte resource, or your program will crash on a
  896. 68040.
  897.  
  898. Tim Dierks
  899. MacDTS, but I speak for myself.
  900.  
  901.  
  902.  
  903. - -------------------------
  904.  
  905. From: quesnel@ems (Rene Quesnel)
  906. Subject:  How to test an MDEF
  907. Date: 19 Feb 92 00:16:55 GMT
  908. Organization: Faculty of Music, McGill University
  909.  
  910. In article <20411@goofy.Apple.COM> ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser) writes:
  911. >Use one of my favorite tricks, the 6-byte resource trick.  Create a test
  912. >program which uses your MDEF.  Add your MDEF function to the program, then
  913. >create a 6-byte resource of type MDEF, with the appropriate resoure ID,
  914. >which you add to your program.  In your program, load the MDEF and fill
  915. >the first two bytes with $4EF9 and the last four bytes with a pointer to
  916. >your MDEF function (which you link in with your code).  
  917.  
  918. *** Part of the text deleted ***
  919.  
  920. >I almost forgot- it's very important that you flush the instruction cache
  921. >after filling in the 6-byte resource, or your program will crash on a
  922. >68040.
  923.  
  924. Can you expand a little bit on that last comment? Why is it necessary to
  925. flush the instruction cache? how do you dot it? Does this apply to 
  926. CDEF's as well?
  927.  
  928. Thanks,
  929.  
  930. Rene Quesnel
  931. quesnel@music.mcgill.ca
  932.  
  933.  
  934.  
  935. - -------------------------
  936.  
  937. From: siegel@world.std.com (Rich Siegel)
  938. Subject:  How to test an MDEF
  939. Date: 19 Feb 92 04:59:34 GMT
  940. Organization: Symantec Language Products Group
  941.  
  942. In article <20411@goofy.Apple.COM> ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser) writes:
  943. >
  944. >Use one of my favorite tricks, the 6-byte resource trick....
  945.  
  946. >I almost forgot- it's very important that you flush the instruction cache
  947. >after filling in the 6-byte resource, or your program will crash on a
  948. >68040.
  949.  
  950. It's not *that* important - unless some sadist breaks the Toolbox, it's not
  951. an absolute necessity to flush the caches when installing a custom defproc
  952. of any sort on the fly, because it seems that all paths on the way back from
  953. loading a defproc end up flushing the cache. Stylistically, you might want
  954. to flush the cache, but it isn't essential.
  955.  
  956. To see the 6-byte resource trick in action, look at the ObjectDraw sample that
  957. ships with THINK Pascal, or look in the "MDEF (LS Pascal)" folder on every
  958. developer CD that's been produced.
  959.  
  960. R.
  961.  
  962.  
  963.  
  964. -- 
  965. - ---------------------------------------------------------------------
  966. Rich Siegel                              Internet: siegel@world.std.com
  967. Senior Software Engineer                 Applelink: SIEGEL
  968. Symantec Languages Group
  969.  
  970.  
  971.  
  972. - -------------------------
  973.  
  974. From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
  975. Subject:  How to test an MDEF
  976. Date: 19 Feb 92 09:34:02 GMT
  977. Organization: Royal Institute of Technology, Stockholm, Sweden
  978.  
  979. > quesnel@ems (Rene Quesnel) writes:
  980.  
  981.    >create a 6-byte resource of type MDEF, with the appropriate resoure ID,
  982.    >which you add to your program.  In your program, load the MDEF and fill
  983.    >the first two bytes with $4EF9 and the last four bytes with a pointer to
  984.    >your MDEF function (which you link in with your code).  
  985.  
  986.    >I almost forgot- it's very important that you flush the instruction cache
  987.    >after filling in the 6-byte resource, or your program will crash on a
  988.    >68040.
  989.  
  990.    Can you expand a little bit on that last comment? Why is it necessary to
  991.    flush the instruction cache? how do you dot it? Does this apply to 
  992.    CDEF's as well?
  993.  
  994. Anywhere where you generate or modify code on the fly (as here,
  995. where you generate a JMP intruction) you have to flush the cache,
  996. since the code is generated into data space, and thus may not be
  997. "seen" if the code cache already contains the previous values of
  998. those memory locations.
  999.  
  1000. Flushing the cacle is done through calling _CacheFlush. Of course,
  1001. you must check for availability, but a "cheap" check might be to
  1002. assume any mac with processor >= 68020 has _CacheFlush.
  1003.  
  1004. Oh, some routines, such as GetResource and BlovkMove for more than
  1005. 12 bytes flush the cache for you. It's all detailed in the technote
  1006. "cache as cache can."
  1007.  
  1008.  
  1009.  
  1010. --
  1011. This Signature is distributed under the conditions of the Signature License,
  1012. available at a fee from   h+@nada.kth.se  (Jon W{tte)  Reading the Signature
  1013. implies that you accept to be bound by the terms in said License. Should you
  1014. not agree on any of these terms, you must return the Signature unread to me.
  1015.  
  1016.  
  1017.  
  1018. - -------------------------
  1019.  
  1020. Subject:  How to test an MDEF
  1021. From: phl01@ccu1.aukuni.ac.nz (Tim Hammett)
  1022. Date: Thu, 20 Feb 1992 01:42:01 GMT
  1023. Organization: University of Auckland, New Zealand.
  1024.  
  1025. In article <20411@goofy.Apple.COM> ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser) writes:
  1026. >
  1027. >Use one of my favorite tricks, the 6-byte resource trick....
  1028.  
  1029. >I almost forgot- it's very important that you flush the instruction cache
  1030. >after filling in the 6-byte resource, or your program will crash on a
  1031. >68040.
  1032.  
  1033. I'm confused by the above. If the resource/memory/whatever manager didn't
  1034. handle it for you, would you want to flush the instruction cache, the data
  1035. cache, or both? I would have thought both - the data cache to ensure that
  1036. the changes you made get written back into RAM, and the instruction cache
  1037. in case there was some code where the resource was previously which is
  1038. still in the cache.
  1039.  
  1040. Thanks in advance to anyone who can enlighten me...
  1041.  
  1042.       --- Tim.
  1043. -- 
  1044.  
  1045. Tim Hammett, Department of Botany, Auckland University, New Zealand.
  1046. e-mail: phl01@ccu1.aukuni.ac.nz       Phone: (+64)-9-373-7999 x8365
  1047.  
  1048.  
  1049.  
  1050. ---------------------------
  1051.  
  1052. From: Carl.Constantine@BCSystems.GOV.BC.CA
  1053. Subject: Menus in THINK C 5.0.2, best way??
  1054. Date: 14 Feb 92 05:16:33 GMT
  1055. Organization: BC Systems Corporation
  1056.  
  1057. I've got an interesting problem/question.  I'm desperately trying to learn C
  1058. with THINK C 5.0.2 on a Mac Plus with 4MB RAM, and System 7.0* (w/ tuneup). 
  1059. I'm reading 2 books currently on Mac C programming for THINK C.  They are
  1060. "Programming for System 7" by Gary Little and "Macintosh C Programming by
  1061. Example" by Thom Hogan and Kurt WQ.G. Matthies (the 2 that were writing the
  1062. "Power Programming" column in MacUser awhile ago.
  1063.  
  1064. My problem is this: in the book on System 7, the Shell.c file seems to treat
  1065. menus (and their handles) locally.  When a MouseDown event occurs in the
  1066. MenuBar, he calls AdjustMenus(); to resetup the menus all over again (ie: he
  1067. enables and disables the items, etc).  His code looks something like this:
  1068.  
  1069. /* from the EventLoop */
  1070.  
  1071. ...
  1072. switch ( event->what ) {
  1073.     case MouseDown:
  1074.         windowPart = FindWindow( event->where, &window );
  1075.         switch ( windowPart ) {
  1076.             AdjustMenus();    /* prepare menu items first */
  1077.             DoMenuCommand ( MenuSelect( event->where ) );
  1078.             break;
  1079. ....
  1080.  
  1081. /* now the adjust menus */
  1082.  
  1083. void AdjustMenus( void )
  1084. {
  1085.     WindowPtr    wp;
  1086.     MenuHandle    fileMenu, editMenu, specialMenu;
  1087.  
  1088.     wp = FrontWindow();
  1089.  
  1090.     fileMenu = GetMHandle( mfile );
  1091.     editMenu = GetMHandle( medit );
  1092.     specialMenu = GetMHandle( mSpecial );
  1093.  
  1094.     DisableItem...
  1095.     ..
  1096. }
  1097.  
  1098. Now in the other book by Thom Hogan, it treats the menus as gloabals (the way
  1099. the should as far as I know.  That's the way I did it in a THINK Pascal program
  1100. I wrote!!!!)
  1101.  
  1102. Which way is best...or is there a "best" way??????
  1103. Any help is muchly appreciated!!!!
  1104.  
  1105. -- 
  1106. Carl.Constantine@BCSystems.gov.bc.ca
  1107. British Columbia, Canada
  1108.  
  1109.  
  1110.  
  1111. - -------------------------
  1112.  
  1113. Subject: Think C 5.02 multisegm. DA bug???
  1114. From: guelzow@brandonu.ca
  1115. Date: 18 Feb 92 09:21:54 CST
  1116. Organization: Brandon University, Brandon, Manitoba, Canada
  1117.  
  1118. Does anybody know anything about a bug in Think C 5.02 (and 4) related to the
  1119. header used for deskaccessories?
  1120. I am writing a multisegment deskaccessory. I usually cannot make it cause a
  1121. system error except in a very specific kind of circumstances:
  1122. On an LC (and possibly other machines, but not on a Plus) running system 6.07
  1123. without MF (and possibly other system configurations): After the DA has been 
  1124. freshly installed, i.e. the computer has not been rebooted since the DA was
  1125. moved into the System by DA mover 3.8 or 4.1 and the DA was not already in
  1126. the system, selecting the DA from the Apple menu causes an immediate
  1127. "illegal instruction" system error: the programme tries to execute an
  1128. instruction not in any heap zone but happens to be 2 bytes off the proper
  1129. allignment.
  1130. This error occurs before any of my instructions are reached, i.e. a
  1131. Debugstr call at the beginning of main is never executed.
  1132. --
  1133. Thanks for any hints I could be given! 
  1134. - -----------------------------------------------------------------------------
  1135. Andreas Guelzow  Dept. of Mathematics & Comp. Sc. Brandon University MB Canada
  1136. Guelzow@BrandonU.Ca
  1137.  
  1138.  
  1139.  
  1140. - -------------------------
  1141.  
  1142. From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser)
  1143. Subject:  Menus in THINK C 5.0.2, best way??
  1144. Date: 17 Feb 92 18:38:49 GMT
  1145. Organization: MacDTS, Apple Computer
  1146.  
  1147. In article <1992Feb14.131633.285@bcsystems.gov.bc.ca>, Carl.Constantine@BCSystems.GOV.BC.CA writes:
  1148. > My problem is this: in the book on System 7, the Shell.c file seems to treat
  1149. > menus (and their handles) locally.  When a MouseDown event occurs in the
  1150. > MenuBar, he calls AdjustMenus(); to resetup the menus all over again (ie: he
  1151. > enables and disables the items, etc).  His code looks something like this:
  1152. [...]
  1153. > Now in the other book by Thom Hogan, it treats the menus as gloabals (the way
  1154. > the should as far as I know.  That's the way I did it in a THINK Pascal program
  1155. > I wrote!!!!)
  1156. > Which way is best...or is there a "best" way??????
  1157. > Any help is muchly appreciated!!!!
  1158.  
  1159. Well, there's never a "best" way in anything as nebulous as Mac programming....
  1160.  
  1161. Anyway, many people take the approach of only setting up the menus just as the user
  1162. clicks in the menu bar, because it's simple (you localize all your code) and fast
  1163. enough that the user usually doesn't notice any delay.  This is considered an advantage
  1164. over enabling and disabling items every time the user takes an action.  Basically,
  1165. it's up to you, and either approach could be better depending on your situation.  For
  1166. example, if I was writing an object drawing program, I'd probably enable on menu select,
  1167. because it's going to be more convenient than dealing with a lot of menu items ("Move 
  1168. Forward", "Move Backward", line size, type size, on and on...) every time the user
  1169. selects an object.  But if I was writing a simple program with one window and three
  1170. menu items, "Open", "Close" and "Quit", I'd just enable them and disable them as it
  1171. goes.
  1172.  
  1173. Note that the one element that is always visible is the menu bar titles.  If you disable
  1174. all the items in a menu, strictly speaking, you are supposed to disable the menu item
  1175. itself.  If you use the "enable on mousedown" method, this could lead to the user
  1176. clicking on a menu, only to find it disable itself under the mouse, just as the user
  1177. intended to use it.  This could be somewhat disconcerting, so most "on menu click"
  1178. method programs never disable menu titles, even if all the items are disabled; this
  1179. could be construed to be in violation of strict interface guidlines.
  1180.  
  1181. Tim Dierks
  1182. MacDTS, but I speak for myself
  1183.  
  1184.  
  1185.  
  1186. - -------------------------
  1187.  
  1188. From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser)
  1189. Subject:  Menus in THINK C 5.0.2, best way??
  1190. Date: 17 Feb 92 18:39:02 GMT
  1191. Organization: MacDTS, Apple Computer
  1192.  
  1193. In article <1992Feb14.131633.285@bcsystems.gov.bc.ca>, Carl.Constantine@BCSystems.GOV.BC.CA writes:
  1194. > My problem is this: in the book on System 7, the Shell.c file seems to treat
  1195. > menus (and their handles) locally.  When a MouseDown event occurs in the
  1196. > MenuBar, he calls AdjustMenus(); to resetup the menus all over again (ie: he
  1197. > enables and disables the items, etc).  His code looks something like this:
  1198. [...]
  1199. > Now in the other book by Thom Hogan, it treats the menus as gloabals (the way
  1200. > the should as far as I know.  That's the way I did it in a THINK Pascal program
  1201. > I wrote!!!!)
  1202. > Which way is best...or is there a "best" way??????
  1203. > Any help is muchly appreciated!!!!
  1204.  
  1205. Well, there's never a "best" way in anything as nebulous as Mac programming....
  1206.  
  1207. Anyway, many people take the approach of only setting up the menus just as the user
  1208. clicks in the menu bar, because it's simple (you localize all your code) and fast
  1209. enough that the user usually doesn't notice any delay.  This is considered an advantage
  1210. over enabling and disabling items every time the user takes an action.  Basically,
  1211. it's up to you, and either approach could be better depending on your situation.  For
  1212. example, if I was writing an object drawing program, I'd probably enable on menu select,
  1213. because it's going to be more convenient than dealing with a lot of menu items ("Move 
  1214. Forward", "Move Backward", line size, type size, on and on...) every time the user
  1215. selects an object.  But if I was writing a simple program with one window and three
  1216. menu items, "Open", "Close" and "Quit", I'd just enable them and disable them as it
  1217. goes.
  1218.  
  1219. Note that the one element that is always visible is the menu bar titles.  If you disable
  1220. all the items in a menu, strictly speaking, you are supposed to disable the menu item
  1221. itself.  If you use the "enable on mousedown" method, this could lead to the user
  1222. clicking on a menu, only to find it disable itself under the mouse, just as the user
  1223. intended to use it.  This could be somewhat disconcerting, so most "on menu click"
  1224. method programs never disable menu titles, even if all the items are disabled; this
  1225. could be construed to be in violation of strict interface guidlines.
  1226.  
  1227. Tim Dierks
  1228. MacDTS, but I speak for myself
  1229.  
  1230.  
  1231.  
  1232. ---------------------------
  1233.  
  1234. End of C.S.M.P. Digest
  1235. **********************
  1236.